package edu.lingnan.house.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import edu.lingnan.house.mapper.AgentMapper_lxj;
import edu.lingnan.house.pojo.TbAgent;
import edu.lingnan.house.service.AgentService_lxj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AgentServiceImpl_lxj implements AgentService_lxj {

    @Autowired
    private AgentMapper_lxj agentMapper;

    //中介查找个人信息
    @Override
    public TbAgent findSelfById(String agentId) {
        QueryWrapper<TbAgent> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",agentId);
        TbAgent agent = agentMapper.selectOne(queryWrapper);
        return agent;
    }

    @Override
    public int updateMySelf(TbAgent agent) {
        QueryWrapper<TbAgent> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",agent.getId());
        int row = agentMapper.update(agent, queryWrapper);
        return row;
    }
}
